#ifndef __FAST_RPC_CONFIG_H__
#define __FAST_RPC_CONFIG_H__

#include "yaml-cpp/yaml.h"

#include "log.h"

namespace fast_rpc
{

using Config = YAML::Node;

template <typename T>
void GetValueOfKey(const Config& config, const std::string& key, T& value)
{
    if (!config[key].IsDefined()) {
        LOG_WARN("not find value of key: %s, use default", key.c_str());
        return;
    }
    value = config[key].as<T>();
}


} // fast_rpc

#endif // __FAST_RPC_CONFIG_H__